package org.shj.spring.boot.base;

import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;

/**
 * 添加对于Page offset分页的支持
 **/
public class OffsetLimitPageable extends PageRequest {

    private int offset;

    public OffsetLimitPageable(int offset, int limit) {
        super(0, limit);
        this.offset = offset;
    }

    public OffsetLimitPageable(int offset, int limit, Sort sort) {
        super(offset, limit, sort);
        this.offset = offset;
    }

    @Override
    public int getOffset() {
        return this.offset;
    }
}
